package com.yihuier.yihuier.Service.UserManager;

import com.yihuier.yihuier.Mapper.UserManager.UserFaceInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;

@Service
public class UserFaceInfoService {
    @Autowired
    private UserFaceInfoMapper userFaceInfoMapper;

    /**
     * 添加用户时，向user_face_status中添加
     * */
    public int addUserFaceInfo(int user_id){
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
        String create_time = df.format(new Date());
        return userFaceInfoMapper.addUserFaceInfo(user_id,create_time,create_time);
    }

    /**
     * 查询用户的特征值是否填入完毕
     * */
    public String getAddFaceIdStatusByUserId(int user_id){
        return userFaceInfoMapper.selectAddFaceIdStatusByUserId(user_id);
    }
}
